import axiosinstance from "../utils/axiosInstances";

export function reportList(){
    return axiosinstance.get("/system/report-templates/listAll")
}

export function getTableData(params: any){
    return axiosinstance.get("/datav/common/table/getBasicTable",{
        params,
    });
}

export async function tableExport(tableInfo: ITable, xlsxName: string) {
    Message.loading({
        content: "正在下载数据，请稍候",
        duration: 6000 * 1000
    });
    try {
        await new ElMapExportTable(tableInfo).download(`${xlsxName} ${dayjs().format('YYYY-MM-DD HH:mm:ss')}`);
        Message.clear();
        Message.success("导出成功");
    } catch (error) {
        Message.clear();
        Message.error("导出失败");
    }
}
